﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace LED_Tester
{
    public partial class frmSDCM : Form
    {
        public frmSDCM()
        {
            InitializeComponent();
        }

        private int index;
        private int lo;
        private int hi;

        public int Index
        {
            get { return index; }
            set { index = value; }
        }
        public int Lo
        {
            get { return lo; }
            set { lo = value; }
        }
        public int Hi
        {
            get { return hi; }
            set { hi = value; }
        }

        private void frmSDCM_Load(object sender, EventArgs e)
        {
            listBox1.SelectedIndex = index;
            textBox1.Text = lo.ToString();
            textBox2.Text = hi.ToString();
        }

        private void frmSDCM_FormClosing(object sender, FormClosingEventArgs e)
        {
            index = listBox1.SelectedIndex;
            lo = int.Parse(textBox1.Text);
            hi = int.Parse(textBox2.Text);
        }

        private void button1_Click(object sender, EventArgs e)
        {
            if (textBox1.Text == "" || textBox2.Text == "")
            {
                MessageBox.Show("请正确输入阶数！", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }

            DialogResult = DialogResult.OK;
        }

        private void button2_Click(object sender, EventArgs e)
        {
            DialogResult = DialogResult.Cancel;
        }
    }
}
